
; CC8E Version 1.3D, Copyright (c) B Knudsen Data
; C compiler for the PIC18 microcontrollers
; ************  30. Sep 2011  13:06  *************

	processor  PIC18F4520
	radix  DEC

Carry       EQU   0
TRISB       EQU   0xF93
PORTB       EQU   0xF81
i_2         EQU   0x01

	GOTO main

  ; FILE ting.c
			;
			;
			;void delay();
			;
			;void main()
			;{
main
			;	int i;
			;	TRISB=0x00; // initialiser porten B til utport
	CLRF  TRISB,0
			;
			;	while (1)
			;	{	
			;		PORTB=0; // slukk alle lys
m001	CLRF  PORTB,0
			;		delay();
	RCALL delay
			;		PORTB.0=1; // tenn RB2-dioden
	BSF   PORTB,0,0
			;		delay();
	RCALL delay
			;		PORTB.1=1; // tenn RB2-dioden
	BSF   PORTB,1,0
			;		delay();
	RCALL delay
			;		PORTB.2=1; // tenn RB2-dioden
	BSF   PORTB,2,0
			;		delay();
	RCALL delay
			;		PORTB.3=1; // tenn RB3-dioden
	BSF   PORTB,3,0
			;		delay();
	RCALL delay
			;	}
	BRA   m001
			;}
			;
			;
			;void delay()
			;{
delay
			;	uns16 i;
			;	for (i=0;i<50000;)
	CLRF  i_2,0
	CLRF  i_2+1,0
m002	MOVLW 80
	SUBWF i_2,W,0
	MOVLW 195
	SUBWFB i_2+1,W,0
	BTFSC 0xFD8,Carry,0
	BRA   m003
			;	{
			;		i++;
	INCF  i_2,1,0
	MOVLW 0
	ADDWFC i_2+1,1,0
			;	}
	BRA   m002
m003	RETURN

	END


; *** KEY INFO ***

; 0x00001C   13 word(s)  0 % : delay
; 0x000004   12 word(s)  0 % : main

; RAM usage: 3 bytes (3 local), 1533 bytes free
; Maximum call level: 1
; Total of 27 code words (0 %)
